from datetime import datetime
from typing import Optional, List

from pydantic import BaseModel


class CourseInfo(BaseModel):
    id: Optional[int] = 0
    course_type: Optional[str] = 0
    course_name: Optional[str] = None
    course_content_id: Optional[int] = 0


class ClassInfo(BaseModel):
    id: Optional[int] = 0
    class_name: Optional[str] = None
    class_type: Optional[int] = 0
    course_id: Optional[int] = 0
    teacher_id: Optional[int] = 0
    lecturer_id: Optional[int] = 0
    start_date: Optional[str] = None
    end_date: Optional[str] = None
    status: Optional[int] = 0


class EmployeeInfo(BaseModel):
    id: Optional[int] = 0
    phone: Optional[str] = None
    email: Optional[str] = None
    name: Optional[str] = None
    sex: Optional[int] = 0
    port: Optional[int] = 0
    status: Optional[int] = 0
    entry_date: Optional[str] = None
    leave_date: Optional[str] = None


class StudentInfo(BaseModel):
    id: Optional[int] = 0
    name: Optional[str] = None
    address: Optional[str] = None
    age: Optional[str] = 0
    sex: Optional[int] = 0
    class_id: Optional[int] = 0
    phone: Optional[str] = None
    email: Optional[str] = None
    school: Optional[str] = None
    school_type: Optional[int] = 0
    major: Optional[str] = 0
    graduation_date: Optional[str] = None
    has_graduation_cert: Optional[bool] = None
    is_monitor: Optional[int] = 0
    status: Optional[int] = 0
    contact_person_phone: Optional[str] = None
    sale_id: Optional[int] = 0
    source: Optional[int] = 0
    referrer: Optional[str] = None
    pay_type: Optional[int] = 0
    loan_amount: Optional[float] = 0
    pay_amount: Optional[float] = 0


class AttendanceInfo(BaseModel):
    id: Optional[int] = 0
    attend_date: Optional[str] = None
    class_id: Optional[int] = 0
    student_id: Optional[int] = 0
    is_normal: Optional[bool] = None
    abnormal_type: Optional[int] = 0
    remark: Optional[str] = None


class CourseStageInfo(BaseModel):
    id: Optional[int] = 0
    course_content_id: Optional[int] = 0
    course_stage_name: Optional[str] = None
    sort_id: Optional[int] = 0


class CourseStageSubjectInfo(BaseModel):
    id: Optional[int] = 0
    course_stage_id: Optional[int] = 0
    subject_id: Optional[int] = 0
    sort_id: Optional[int] = 0


class EmploymentInfo(BaseModel):
    id: Optional[int] = 0
    student_id: Optional[int] = 0
    company_name: Optional[str] = None
    work_location: Optional[str] = None
    station: Optional[str] = None
    entry_date: Optional[str] = None
    salary: Optional[float] = 0
    offer: Optional[str] = None
    is_entry: Optional[int] = 0
    remark: Optional[str] = None


class InterviewInfo(BaseModel):
    id: Optional[int] = 0
    student_id: Optional[int] = 0
    interview_type: Optional[int] = 0
    company_name: Optional[str] = None
    work_location: Optional[str] = None
    interview_time: Optional[datetime] = None
    interview_rounds: Optional[int] = 0
    interview_result: Optional[int] = 0
    interview_record: Optional[str] = None
    lecturer_id: Optional[int] = 0
    lecturer_comment: Optional[str] = None


class InterviewContentInfo(BaseModel):
    id: Optional[int] = 0
    interview_id: Optional[int] = 0
    question: Optional[str] = None
    answer: Optional[str] = None


class NoticeInfo(BaseModel):
    id: Optional[int] = 0
    user_id: Optional[int] = 0
    notice_topic: Optional[str] = None
    notice_content: Optional[str] = None
    notice_members: Optional[str] = None
    notice_copy_members: Optional[str] = None


class SubjectInfo(BaseModel):
    subject_id: Optional[int] = 0
    subject_name: Optional[str] = None


class SubjectSectionInfo(BaseModel):
    subject_id: Optional[int] = 0
    section_id: Optional[int] = 0
    section_name: Optional[str] = None
    section_type: Optional[int] = 0
    section_url: Optional[str] = None
    section_test_id: Optional[int] = 0
    sort_id: Optional[int] = 0


class BatchAttendanceInfo(BaseModel):
    attend_date: str
    class_id: int
